#include <stdio.h>

int main()
{
  int scores[3][5];
  int rows = sizeof(scores) / sizeof(scores[0]);
  int cols = sizeof(scores[0]) / sizeof(scores[0][0]);
  double class_sum = 0, all_class_sum = 0;

  for (int i = 0; i < rows; i++)
  {
    for (int j = 0; j < cols; j++)
    {
      printf("请输入%d班%d号学生的成绩:", i + 1, j + 1);
      scanf("%d", &scores[i][j]);
    }
  }
  printf("==================================\n");
  for (int i = 0; i < rows; i++)
  {
    for (int j = 0; j < cols; j++)
    {
      printf("%d\t", scores[i][j]);
    }
    printf("\n");
  }
  printf("==================================\n");
  for (int i = 0; i < rows; i++)
  {
    class_sum = 0;
    for (int j = 0; j < cols; j++)
    {
      class_sum += scores[i][j];
      all_class_sum += scores[i][j];
    }
    printf("%d班总成绩为%.2lf:\n", i+1, class_sum);
    printf("%d班平均成绩为:%.2lf\n",i+1,class_sum/cols);
  }
  printf("总成绩为%.2lf\n",all_class_sum);
  printf("平均成绩为:%.2lf\n",all_class_sum/(rows*cols));
  return 0;
}